# Makefile

JAVA_TARGET = Task1/HelloWorld.class
CPP_TARGETS = Task3/primes Task3/primes-easy

JAVAC = javac
CPP_COMPILER = g++

JAVA_SRC = Task1/HelloWorld.java
CPP_SRCS = Task3/primes.cpp Task3/primes-easy.cpp

all: $(JAVA_TARGET) $(CPP_TARGETS)

$(JAVA_TARGET): $(JAVA_SRC)
	$(JAVAC) $<

$(CPP_TARGETS): Task3/primes Task3/primes-easy

Task3/primes: Task3/primes.cpp
	$(CPP_COMPILER) $< -o $@

Task3/primes-easy: Task3/primes-easy.cpp
	$(CPP_COMPILER) $< -o $@

java:
	$(JAVAC) $(JAVA_SRC)

cpp:
	$(CPP_COMPILER) Task3/primes.cpp -o Task3/primes
	$(CPP_COMPILER) Task3/primes-easy.cpp -o Task3/primes-easy

clean:
	rm -f $(JAVA_TARGET) $(CPP_TARGETS)

.PHONY: all java cpp clean

